/*
* @author dumeng
*/
'use strict'
import request from '@/utils/request'
/**
 * 异步企业部门树
 */
export function getComAndOrgTree(data) {
  return request({
    baseURL: '/API-ENTERPRISE-BACKEND/',
    url: '/backend/departmentInfo/getDeptTree',
    method: 'post',
    data
  })
}

/**
 * 字典
 */
export function getDictByCode(dictCode) {
  return request({
    baseURL: '/API-ENTERPRISE-BACKEND/',
    url: '/backend/sysDictionary/getDictByCode',
    method: 'POST',
    data: { dictCode }
  })
}

export function queryPage(data) {
  return request({
    baseURL: '/API-ENTERPRISE-BACKEND/',
    url: 'backend/solicitationInfo/queryPage',
    method: 'post',
    data
  })
}

export function get(data) {
  return request({
    baseURL: '/API-ENTERPRISE-BACKEND/',
    url: '/backend/solicitationInfo/get',
    method: 'post',
    data
  })
}

export function insert(data) {
  return request({
    baseURL: '/API-ENTERPRISE-BACKEND/',
    url: '/backend/solicitationInfo/insert',
    method: 'post',
    data
  })
}

export function update(data) {
  return request({
    baseURL: '/API-ENTERPRISE-BACKEND/',
    url: '/backend/solicitationInfo/update',
    method: 'post',
    data
  })
}

export function updateState(data) {
  return request({
    baseURL: '/API-ENTERPRISE-BACKEND/',
    url: 'backend/solicitationInfo/updateStatus',
    method: 'post',
    data
  })
}

export function del(data) {
  return request({
    baseURL: '/API-ENTERPRISE-BACKEND/',
    url: '/backend/solicitationInfo/deleteById',
    method: 'post',
    data
  })
}

export function queryPage4answer(data) {
  return request({
    baseURL: '/API-ENTERPRISE-BACKEND/',
    url: '/backend/questionnaireSurvey/questionaryStatisticsDetil',
    method: 'post',
    data
  })
}


/**
 * 活动--设置-获奖作品发布状态
 * @param data
 * @returns {*}
 */
export function setAwardState(data) {
  return request({
    baseURL: '/API-ENTERPRISE-BACKEND/',
    url: '/backend/solicitationInfo/update',
    method: 'post',
    data
  })

 /* return request({
    baseURL: '/API-ENTERPRISE-BACKEND/',
    url: '/backend/worksShow/updateEvaluateState',
    method: 'post',
    data
  })*/
}

/**
 * 统一修改-评分状态
 */
export function setEvaluateState(data) {
  return request({
    baseURL: '/API-ENTERPRISE-BACKEND/',
    url: '/backend/info/xw/updateEvaluateState',
    method: 'post',
    data
  })
}

/**
 * 统一修改-点赞状态
 */
export function setFavorState(data) {
  return request({
    baseURL: '/API-ENTERPRISE-BACKEND/',
    url: '/backend/info/xw/updateFavorState',
    method: 'post',
    data
  })
}

/**
 * 统一修改-评论状态
 */
export function setCommentState(data) {
  return request({
    baseURL: '/API-ENTERPRISE-BACKEND/',
    url: '/backend/info/xw/updateCommentState',
    method: 'post',
    data
  })
}
